private class EventLogEditor.XESEditorKit extends XMLEditorKit
XMLEditorKit
for creating a specific editor kit for this
EventLogEditor
internal frame.
This class overrides the keyPressed(KeyEvent)
of the superclass to manage the users's key
pressing on the keyboard.
When the user makes the first change inside the EventLogEditor.editorArea
, this method changes the
isContentModified
status of the EventLogEditor
,
setting it as true
. Then it sets the visual status of the event log editor in a specific way
to show that the content is currently modified from the last time (adding an asterisk at the end of the
EventLogEditor
title and the end of the the
associated FooterAreaButton
title).
When the user utilises some shortcuts inside the editor area instead (using the CONTROL key or the ALT key and some key letter for example), this method checks if the used shortcut is in the list of available ones and in that case it implements the function connected to that specific shortcut.
XMLEditorKit
,
EventLogEditor
,
FooterAreaButton
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Auto-Generated Serial Version UID for this class.
|
ERROR_HIGHLIGHTING_ATTRIBUTE
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
ATTRIBUTE_NAME, ATTRIBUTE_PREFIX, ATTRIBUTE_VALUE, CDATA, COMMENT, DECLARATION, ELEMENT_NAME, ELEMENT_PREFIX, ELEMENT_VALUE, ENTITY, ENTITY_REFERENCE, NAMESPACE_NAME, NAMESPACE_PREFIX, NAMESPACE_VALUE, SPECIAL, STRING, WHITESPACE
Modifier | Constructor and Description |
---|---|
private |
XESEditorKit() |
Modifier and Type | Method and Description |
---|---|
private FooterAreaButton |
findFooterAreaButton()
Searches for the associated
FooterAreaButton button of this
EventLogEditor , returning it or null otherwise. |
void |
keyPressed(KeyEvent event)
This method gets all the
KEY_PRESSED events made inside the editor kit. |
void |
keyTyped(KeyEvent keyevent)
This method gets all the
KEY_TYPED events made inside the editor kit. |
private void |
modifyEventLogEditorTitles(String newTitle)
Sets the title of this
EventLogEditor as the newTitle passed as parameter
and then updates all its references in the associated FooterAreaButton to keep
the integrity and the association between them. |
deinstall, getContentType, getViewFactory, install, keyReleased, setAutoIndentation, setStyle, setTagCompletion
createCaret, createDefaultDocument, getActions, read, read, write, write
private static final long serialVersionUID
public void keyPressed(KeyEvent event)
KEY_PRESSED
events made inside the editor kit.
The duty of this method is to check whenever a combination of keys pressed is a specific shortcut defined in its list and to implement the connected function to these shortcuts when they are used.
It does do nothing for all the key pressed that are not one of this shortcuts, because
the keyTyped(KeyEvent)
method will take care of all the other situations when the user
modify the content of the editor kit. This method is used only for defining shortcuts
for the editor kit that the keyTyped(KeyEvent)
method can't handle.
keyPressed
in interface KeyListener
keyPressed
in class XMLEditorKit
event
- the KeyEvent
generated by the editor kitpublic void keyTyped(KeyEvent keyevent)
KEY_TYPED
events made inside the editor kit.
The duty of this method is to change the isContentModified
status of this EventLogEditor
,
setting it as true
when the user makes the first change inside the editor
kit (adding or deleting something to the saved content that is already in it).
It also sets the visual status of the event log editor in a specific way to show that the
content is currently modified from the last time (adding an asterisk at the end of this
EventLogEditor
title and at the end of
the title of its associated FooterAreaButton
button).
At the end, this method sets the isContentValidated
status to false
, because the content has been modified and it needs to be validated again.
This method does not do anything for all the key pressed that are in combination with the CONTROL key
or the ALT key, because they are intended to be shortcuts and so are left to the keyPressed(KeyEvent)
method that will take care of them.
keyTyped
in interface KeyListener
keyTyped
in class XMLEditorKit
keyevent
- the KeyEvent
generated by the editor kitprivate void modifyEventLogEditorTitles(String newTitle)
EventLogEditor
as the newTitle
passed as parameter
and then updates all its references in the associated FooterAreaButton
to keep
the integrity and the association between them.newTitle
- the new title of this EventLogEditor
and its associated components on the applicationFooterAreaButton
private FooterAreaButton findFooterAreaButton()
FooterAreaButton
button of this
EventLogEditor
, returning it or null
otherwise.FooterAreaButton
button associated to this EventLogEditor
, null
otherwise.